<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.lmpop.trade.ts_category.*" %> 
 
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page"/>

<%
	String auction_id = randomId.GenTradeId();
	String oper_user_id="";

	if(session.getAttribute("session_user_id")!=null){
		oper_user_id  = session.getAttribute("session_user_id").toString();
	} 
	
	Ts_categoryInfo categoryInfo = new Ts_categoryInfo();
	String cateString = categoryInfo.getSelCatByTLevel("2","1");
%>

<html>
  <head>
    <title>拍卖信息管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="auction.js"></script>
	<script type="text/javascript" >
		function onlyNum(){
			var patrn = /^[0-9]{1,30}$/; 
			var sp = $('#start_price').val();
			if(!patrn.exec(sp)) {
				alert('起拍价只能是数字');
				$('#start_price').focus();
				return false;
			}
			var ap = $('#a_price').val();
			if(!patrn.exec(ap)) {
				alert('一口价只能是数字');
				$('#a_price').focus();
				return false;
			}
			var rp = $('#rate_price').val();
			if(!patrn.exec(rp)) {
				alert('加价幅度只能是数字');
				$('#rate_price').focus();
				return false;
			}
			var mp = $('#margin').val();
			if(!patrn.exec(mp)) {
				alert('保证金只能是数字');
				$('#margin').focus();
				return false;
			}
			
			return true;
		}
	</script>
  </head>

<body>
	<h1>新增拍卖信息</h1>
	

	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<input name="auction_id" id="auction_id" type="hidden" value="<%=auction_id%>"/>
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="15%">
				活动名称<font color="red">*</font>
			</td>
			<td><input name="auction_name" id="auction_name" size="50" maxlength="20" type="text" /></td>
		</tr>
			
		<tr>
			<td align="right" width="20%">
				活动描述:<font color="red">*</font>
			</td>
			<td  colspan="3">
	
			<textarea name="auction_desc" ></textarea> 
			<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
			<script type="text/javascript">
			   CKEDITOR.replace( 'auction_desc',{
			   	filebrowserUploadUrl : '/program/inc/upload.jsp?type=file&attach_root_id=<%=auction_id%>',      
                filebrowserImageUploadUrl : '/program/inc/upload.jsp?type=img&attach_root_id=<%=auction_id%>',      
                filebrowserFlashUploadUrl : '/program/inc/upload.jsp?type=flash&attach_root_id=<%=auction_id%>'     
				});  
			</script>
			
			</td>
		</tr>
		
		<tr>
				<td width="15%" align="right">
				<b>搜索商品：</b>&nbsp;&nbsp;
				</td>
				<td width="85%" align="left">
					<select name="goods_type" id="goods_type">
						<option value="">
							请选择类别
						</option>
						<%=cateString%>
					</select>
					商品名称:
					<input type="text" name="s_good_name" id="s_good_name" 
						maxlength="30" size="15" value="" />
					<span> <input type="button" name="submit_form2"
							id="submit_form2" value="搜索" onClick="return searchGoods()"
							style="height: 23px; text-align: center" /> </span>
				</td>
			</tr>
			<tr>
				<td width="15%" align="right">
					拍卖商品名称:<font color="red">*</font>&nbsp;&nbsp;
				</td>
				<td align="left">
						<select name="good_id" id="good_id">
						</select>
				</td>
			</tr>		
		
		
		<tr>
			<td align="right" width="15%">
				拍卖开始时间<font color="red">*</font>
			</td>
			<td>															
			<input name="start_date" type="text" id="start_date" class="Wdate" value="" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'end_date\',{d:-1})}',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" size="15"  width="150px"/>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				拍卖结束时间<font color="red">*</font>
			</td>
			<td><input name="end_date" id="end_date" type="text" class="Wdate" value="" onClick="WdatePicker({minDate:'#F{$dp.$D(\'start_date\',{d:1})}',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" size="15" width="150px"/></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				起拍价:<font color="red">*</font>
			</td>
			<td><input name="start_price" id="start_price" size="20" maxlength="20" value="1" type="text" onKeyUp="if(!/^[1-9][0-9]*$/.test(this.value))this.value='1';"/><font color="red">&nbsp; *起拍价只能是正整数!</font></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				一口价:
			</td>
			<td><input name="a_price" id="a_price" size="20" maxlength="20" value="0" type="text" onKeyUp="if(!/^[1-9][0-9]*$/.test(this.value))this.value='1';" /></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				加价幅度:
			</td>
			<td><input name="rate_price" id="rate_price" size="20" maxlength="20" value="0" type="text" onKeyUp="if(!/^[1-9][0-9]*$/.test(this.value))this.value='1';" /></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				保证金:
			</td>
			<td><input name="margin" id="margin" size="20" maxlength="20" value="0" type="text" onKeyUp="if(!/^[1-9][0-9]*$/.test(this.value))this.value='0';" /></td>
		</tr>
				
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input name="user_id" id="user_id" type="hidden" value="<%=oper_user_id%>" />
				
				<input type="hidden" name="bpm_id" value="4011" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onClick="checkSub();"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onClick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
